/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 19182
 * Date: 2025-07-18
 * Time: 13:15
 */
import java.util.*;


public class ListNode {
    int val;
    ListNode next = null;
    ListNode tail;
    ListNode head;
    public ListNode(int val) {
        this.val = val;
    }
    public ListNode(){

    }
    public void addLast(int data){
        ListNode Node = new ListNode(data);
        if(head == null){
            head = tail = Node;
            return;
        }
        tail.next = Node;
        tail = Node;
    }
}